<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="UTF-8">
 <meta name="viewport" content="width=device-width, initial-scale=1.0">
 <title>对象的解构</title>
</head>
<body>
 <script>
 //什么是解构赋值
//从容器中快速提取成员的一种方法
obj = {
 name: 'Vivian',
 age: 20,
 gender:'男'
}

//es5 对象名.属性/方法
// let name = obj.name;
// let newAge = obj.age;
// let gender = obj.gender;

// console.log(name, newAge, gender);

//es6 解构赋值
let {name, newAge, gender} = obj;
console.log(name, newAge, gender);
 </script>
</body>
</html>